package cn.niit.smbms.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@Alias("SysUserReceiveAddres")
@AllArgsConstructor
@NoArgsConstructor
public class SysUserReceiveAddres extends BaseEntity{

    private Long sysUserId;  //用户ID，关联sys_user表ID
    @NotBlank(message = "请填写收货人姓名！")
    @Length(min = 2, max = 6, message = "姓名长度必须在2~6位之间！")
    private String receiveName;  //收货人姓名
    @NotBlank(message = "请填写收货电话！")
    @Length(min = 11, max = 11, message = "电话号码必须是11位！")
    private String receivePhone;
    @NotBlank(message = "收货地址不能为空！")
    private String receiveAddress;
    @NotNull(message = "请选择是否为默认地址！")
    private Integer isDefault;

    /** 扩展（冗余）字段，主要用于收货地址列表页显示主表（sys_user）内容 */
    private String sysUserName;  //所属用户姓名
    private Integer sysUserGender;

}
